<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="__LIBS__/layui/css/layui.css">
    <link rel="stylesheet" href="__ASSETS__/css/style.css">
    <link rel="stylesheet" href="__LIBS__/font/css/font-awesome.min.css">


    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="__ASSETS__/js/html5shiv.js"></script>
    <script src="__ASSETS__/js/respond.min.js"></script>
    <![endif]-->

    {block name="css"}{/block}
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部模板 -->
    {include file="common/header" /}
    <!-- 侧边栏数据 -->
    {php} $menuNav = auth()->getNavMenu(){/php}
    <!-- 加载侧边栏 -->
    {include file="common/menu" /}
    <!-- 内容主体 -->
    <div class="layui-body">
        <div style="padding: 15px;">
                    <span class="layui-breadcrumb">
                        <a href="{:url('/backend/index')}">控制台</a>
                        {volist name="menuNav.crumb" id="vo"}
                            <a><i class=<i class="fa {$vo.icon}"></i><cite>{$vo.title}</cite></a>
                        {/volist}
                    </span>
            <hr>
            {block name="content"}{/block}
        </div>
    </div>
</div>
<script src="__LIBS__/layui/layui.js"></script>
<script type="text/javascript">
    // 动态加载JS文件
    function loadJavascript(loadJsPath) {
        var loadScript = document.createElement("script");
        loadScript.type = "text/javascript";
        loadScript.src = loadJsPath + '.js';
        document.body.appendChild(loadScript);
    }

    // 加载插件
    layui.config({base: '__ASSETS__/js/'}).use(['element', 'initialize'], function () {
        var loadJsPath = "{php} echo $menuNav['loadJsPath']['file']{/php}";
        var exists = "{php} echo $menuNav['loadJsPath']['result']{/php}";
        if (exists) {
            // 加载当前页依赖文件
            loadJavascript('__ASSETS__/js/' + loadJsPath);
        } else {
            console.log('__ASSETS__/js/' + loadJsPath + '.js file not exists！');
        }
    });
</script>
{block name="script"}{/block}
</body>
</html>